home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / src / out-of-phase-102-c / OutOfPhase 1.02 Source / OutOfPhase Folder / PcodeSystem.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-23  |  2.6 KB  |  78 lines  |  [TEXT/KAHL]

  1. /* PcodeSystem.h */
  2.  
  3. #ifndef Included_PcodeSystem_h
  4. #define Included_PcodeSystem_h
  5.  
  6. /* PcodeSystem module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* Memory */
  12. /* EventLoop */
  13. /* DataMunging */
  14. /* Alert */
  15. /* FixedPoint */
  16. /* FloatingPoint */
  17. /* PcodeStack */
  18. /* PcodeObject */
  19. /* CodeCenter */
  20. /* SampleConsts */
  21. /* FunctionCode */
  22.  
  23. #include "FixedPoint.h"
  24. #include "SampleConsts.h"
  25.  
  26. /* forward declarations */
  27. struct ParamStackRec;
  28. struct PcodeRec;
  29. struct CodeCenterRec;
  30. union OpcodeRec;
  31.  
  32. /* the errors that can occur when evaluating a pcode program */
  33. typedef enum
  34.     {
  35.         eEvalNoError EXECUTE(= -7865),
  36.         eEvalUndefinedFunction,
  37.         eEvalWrongNumParametersForFunction,
  38.         eEvalWrongParameterType,
  39.         eEvalWrongReturnType,
  40.         eEvalErrorTrapEncountered,
  41.         eEvalUserCancelled,
  42.         eEvalDivideByZero,
  43.         eEvalOutOfMemory,
  44.         eEvalArrayDoesntExist,
  45.         eEvalArraySubscriptOutOfRange,
  46.         eEvalGetSampleNotDefined,
  47.         eEvalGetSampleWrongChannelType
  48.     } EvalErrors;
  49.  
  50. /* evaluate the provided function using the initial stack provided in Prep, */
  51. /* the program provided in Pcode, the object pool provided in CodeCenter, */
  52. /* and the callback routines for obtaining samples.  the SampleName parameter */
  53. /* of the callback routine is a NULL termimated string. */
  54. /* If an error occurs, the OpcodeRec and program counter of the instruction */
  55. /* that generated the exception are returned.  the Prep is used in place, which */
  56. /* means that any changes made to the stack during evaluation will be available */
  57. /* in the Prep when the function returns.  Stack depth is NOT changed, though. */
  58. EvalErrors                EvaluatePcode(struct ParamStackRec* Prep, struct PcodeRec* Pcode,
  59.                                         struct CodeCenterRec* CodeCenter, union OpcodeRec** OffendingPcode,
  60.                                         long* OffendingInstruction, void* Refcon,
  61.                                         SampleErrors (*GetSampleLeftCopy)(void* Refcon, char* SampleName,
  62.                                             largefixedsigned** SampleData),
  63.                                         SampleErrors (*GetSampleRightCopy)(void* Refcon, char* SampleName,
  64.                                             largefixedsigned** SampleData),
  65.                                         SampleErrors (*GetSampleMiddleCopy)(void* Refcon, char* SampleName,
  66.                                             largefixedsigned** SampleData),
  67.                                         SampleErrors (*GetWaveTableFrameCount)(void* Refcon,
  68.                                             char* WaveTableName, long* FrameCountOut),
  69.                                         SampleErrors (*GetWaveTableTableCount)(void* Refcon,
  70.                                             char* WaveTableName, long* TableCountOut),
  71.                                         SampleErrors (*GetWaveTableCopy)(void* Refcon, char* WaveTableName,
  72.                                             largefixedsigned** WaveTableData));
  73.  
  74. /* return a static null terminated string describing an error code. */
  75. char*                            GetPcodeErrorMessage(EvalErrors Error);
  76.  
  77. #endif
  78.